1"use client"; 2 3/** 4 * /f/[slug] — PUBLIC form submission page (no auth; middleware whitelists /f/). 5 * 6 * Loads the PUBLISHED form by slug (GET /public/forms/:slug, no auth) and 7 * renders it with the shared <FormRenderer slug=…/>, which validates + submits 8 * (POST /public/forms/:slug/submit). Only PUBLISHED forms resolve — 9 * draft/closed/unknown slugs 404 on the API and render the "not available" 10 * state (closed forms render their closed state instead). 11 * 12 * Standalone (no (app) shell): this is a top-level public route, so it carries 13 * its own minimal page chrome. 14 */ 15import { useParams } from "next/navigation"; 16import { FormRenderer } from "@/components/form/form-renderer"; 17 18export default function PublicFormPage() { 19 const params = useParams<{ slug: string }>(); 20 const slug = params?.slug ?? ""; 21 22 return ( 23 <main className="min-h-screen bg-background"> 24 <div className="mx-auto max-w-2xl px-6 py-12"> 25 {slug ? ( 26 <FormRenderer slug={slug} className="w-full" /> 27 ) : ( 28 <p className="text-sm text-muted-foreground">Missing form slug.</p> 29 )} 30 </div> 31 </main> 32 ); 33} 34